<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>项目日志管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
		function formDisable(logId){
			var url = "${ctx}/pro/proLog/view?id="+logId;
			top.$.jBox.open("iframe:"+url, "详情",810,$(top.document).height()-120,{
	            buttons:{"关闭":true}, bottomText:"详情",submit:function(v, h, f){
	                var code;
	                if (v=="ok"){
	                	// 执行保存
	                    //loading('正在提交，请稍等...');
	                	h.find("iframe")[0].contentWindow.submitForm();
	                	location.reload();
	                    return false;
	                }
	            }, loaded:function(h){
	                $(".jbox-content", top.document).css("overflow-y","hidden");
	            }
	        });
		}
		function groupForm(groupId,projectId){
			var url = "${ctx}/pro/taskGroup/form?project.id="+projectId+"&id="+groupId;
			top.$.jBox.open("iframe:"+url, "任务组详情",810,$(top.document).height()-120,{
                buttons:{"提交":"ok", "关闭":true}, bottomText:"任务组详情",submit:function(v, h, f){
                    var code;
                    if (v=="ok"){
                    	// 执行保存
                        //loading('正在提交，请稍等...');
                    	var flag = h.find("iframe")[0].contentWindow.submitForm();
                    	if(flag){
                    		location.reload();
                    	}
                        return false;
                    }
                }, loaded:function(h){
                    $(".jbox-content", top.document).css("overflow-y","hidden");
                }
            });
		}
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li><a id="btn" href="${ctx}/pro/taskGroup/list?project.id=${proLog.project.id}">任务组列表</a></li>
		<shiro:hasPermission name="pro:taskGroup:create"><li><a href="javascript:void(0);" onclick="groupForm('','${proLog.project.id}');">任务组添加</a></li></shiro:hasPermission>
		<li class="active"><a href="${ctx}/pro/proLog/?project.id=${proLog.project.id}">项目日志</a></li>
		<li><a href="${ctx}/pro/project/ganttViewData?id=${proLog.project.id}">项目进度</a></li>
		<shiro:hasPermission name="pro:taskGroup:import">
			<li><a href="${ctx}/pro/taskGroup/previewList?project.id=${proLog.project.id}">任务导入</a>
			</li>
         </shiro:hasPermission>
		<%-- <shiro:hasPermission name="pro:proLog:edit"><li><a href="${ctx}/pro/proLog/form">项目日志添加</a></li></shiro:hasPermission> --%>
	</ul>
	<form:form id="searchForm" modelAttribute="proLog" action="${ctx}/pro/proLog/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<input id="projectId" name="project.id" type="hidden" value="${proLog.project.id}"/>
		<a href="${ctx}/pro/project/">项目&gt;&gt;</a>
		<ul class="ul-form">
			<li><label>操作模块：</label>
				<form:select path="module" class="input-medium">
					<form:option value="" label=""/>
					<form:options items="${fns:getDictList('module_type')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select>
			</li>
			<li><label>操作类型：</label>
				<form:select path="type" class="input-medium">
					<form:option value="" label=""/>
					<form:options items="${fns:getDictList('type_type')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select>
			</li>
			<li><label>创建时间：</label>
				<input name="createDate" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate"
					value="<fmt:formatDate value="${proLog.createDate}" pattern="yyyy-MM-dd"/>"
					onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:true});"/>
			</li>
			<li><label>创建人：</label>
				<sys:treeselect id="createBy" name="createBy.id" value="${proLog.createBy.id}" labelName="createBy.name" labelValue="${proLog.createBy.name}"
					title="用户" url="/sys/office/treeData?type=3" cssClass="input-small" allowClear="true" notAllowSelectParent="true"/>
			</li>
			<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>操作模块</th>
				<th>操作类型</th>
				<th>模块信息</th>
				<th>创建时间</th>
				<th>创建人</th>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="proLog">
			<tr>
				<td>
					<c:choose>
						<c:when test="${proLog.type=='1' || proLog.type=='2'}">
							<a href="javascript:void(0);" onclick="formDisable('${proLog.id}');">
								${fns:getDictLabel(proLog.module, 'module_type', '')}
							</a>	
						</c:when>
						<c:otherwise>
							${fns:getDictLabel(proLog.module, 'module_type', '')}
						</c:otherwise>
					</c:choose>
				</td>
				<td>
					${fns:getDictLabel(proLog.type, 'type_type', '')}
				</td>
				<td>
					${proLog.viewData}
				</td>
				<td>
					<fmt:formatDate value="${proLog.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
				</td>
				<td>
					${proLog.createBy.name}
				</td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>